package com.itbaizhan.controller;

import com.itbaizhan.service.AccountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author spf
 * @date 2024/4/14
 * @time 14:20
 */
@RestController
@RequestMapping("/bank1")
public class transferController {

    @Autowired
    private AccountInfoService accountInfoService;

    @GetMapping("/transfer")
    public String transfer(@RequestParam("accountNo") String accountNo, @RequestParam("amount") double amount){
        accountInfoService.transfer(accountNo, amount);
        return "张三转账成功！";
    }

}
